<template>
  <el-dialog v-dialogDrag :visible.sync="dialogVisible" title="成品检验单" width="1000px" :close-on-click-modal="false">
    <button-group ref="buttonGroup" @cancel="dialogVisible = false" />
    <el-row>
      <div class="detailsTop">
        <span>成品检验明细单</span>
        <el-divider content-position="right">{{ detailInfo.checkNo }}</el-divider>
      </div>
      <div class="detailCont detailDialogFont threeDetailStyle">
        <h1 class="titleH1">检验信息</h1>
        <ul>
          <li>
            <b>作业单号</b>
            <span>{{ detailInfo.reportNo }}</span>
          </li>
          <li>
            <b>检验人</b>
            <span>{{ detailInfo.checkUserName }}</span>
          </li>
          <li>
            <b>检验时间</b>
            <span>{{ detailInfo.checkDate }}</span>
          </li>
          <li>
            <b>物料</b>
            <span>{{ detailInfo.materialName }}{{ detailInfo.materialCode ? '【' + detailInfo.materialCode + '】': '' }}</span>
          </li>
          <li>
            <b>合格数</b>
            <span>{{ detailInfo.qualifiedNum }}</span>
          </li>
          <li>
            <b>报工数</b>
            <span>{{ detailInfo.reportNum }}</span>
          </li>
          <li>
            <b>废品数</b>
            <span>{{ detailInfo.badNum }}</span>
          </li>
          <li>
            <b>返工数</b>
            <span>{{ detailInfo.reworkNum }}</span>
          </li>
          <li>
            <b>检验结果</b>
            <span>{{ detailInfo.result === 1 ? '通过':'不通过' }}</span>
          </li>
          <li class="oneHang">
            <b>检验说明</b>
            <span>{{ detailInfo.checkExplain }}</span>
          </li>
        </ul>
        <h1 class="titleH1">入库信息</h1>
        <ul>
          <li>
            <b>库位</b>
            <span>{{ detailInfo.wmsName }}</span>
          </li>
          <li>
            <b>入库单号</b>
            <span>{{ detailInfo.inNo }}</span>
          </li>
          <li>
            <b>入库批次</b>
            <span>{{ detailInfo.inBatch }}</span>
          </li>
          <li>
            <b>入库人名称</b>
            <span>{{ detailInfo.inUserName }}</span>
          </li>
          <li class="oneHang">
            <b>入库备注</b>
            <span>{{ detailInfo.inRemark }}</span>
          </li>
        </ul>
        <el-table ref="table" :data="detailInfo.itemList" border stripe class="tabBoxCont" height="250px">
          <el-table-column show-overflow-tooltip label="检验项" min-width="130px">
            <template #default="{ row }">{{ row.itemName }}{{ row.itemCode ? '【' + row.itemCode + '】' : '' }}</template>
          </el-table-column>
          <el-table-column show-overflow-tooltip prop="remark" label="检验描述" min-width="150px" />
          <el-table-column show-overflow-tooltip label="备注" width="200px" prop="newRemark" />
          <!-- 点检结果-->
          <el-table-column label="检验结果" width="150px" show-overflow-tooltip>
            <template #default="{ row }">{{ row.itemResult === 1 ? '通过':'不通过' }}</template>
          </el-table-column>
        </el-table>
      </div>
    </el-row>
    <bottom-font ref="bottomFont" :obj-name="detailInfo.checkUserName ? detailInfo.checkUserName : this.$store.getters.compInfo.userName" :obj-date="detailInfo.checkDate" />
  </el-dialog>
</template>

<script>
import bottomFont from '@/components/BottomFont'
export default {
  components: { bottomFont },
  props: {},

  data() {
    return {
      detailInfo: {},
      dialogVisible: false // 对话框状态
    }
  },

  watch: {},

  mounted() {},

  methods: {
    async getInfo(row) {
      this.dialogVisible = true
      const res = await this.$axios.get(
        `/qm/product/check/record/detail/${row.id}`
      )
      if (res && res.data.code === 200) {
        this.detailInfo = res.data.data
      }
    }
  }
}
</script>

<style lang='scss' scoped>
</style>

<style lang="scss">
</style>
